home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 12
/
Cream of the Crop 12 (Part II)
/
Cream of the Crop 12 (Part II).iso
/
BBS
/
EZY120_1.ZIP
/
STRUCT.ARJ
/
CLIB.ARJ
/
SETBIT.CPP
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1996-03-09
|
463 b
|
26 lines
#include <ezycom.h>
void SetBitWord(byte Position,int Value,word &ChangeWord)
{
word wd = 0x01 << Position;
if (Value)
ChangeWord = ChangeWord | wd;
else {
wd = wd ^ 0xffff;
ChangeWord = ChangeWord & wd;
}
}
void SetBitByte(byte Position,int Value,byte &ChangeByte)
{
byte wd = 0x01 << Position;
if (Value)
ChangeByte = ChangeByte | wd;
else {
wd = wd ^ 0xff;
ChangeByte = ChangeByte & wd;
}
}